<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0037)https://i.howbuy.com/member/property/ -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的持仓 – 账户资产 - 金牛会员中心</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/saved_resource.css">
	<link href="${pageContext.request.contextPath}/image/logo.png" rel="Shortcut Icon">
<meta name="keywords" content="金牛财富,金牛基金研究中心，资产管理，基金持仓，金牛基金，资产配置">
<meta name="description" content="欢迎登录金牛会员中心，金牛基金网 - 中国领先的第三方投资顾问公司。至力于为广大会员用户提供理财咨询/资产管理/服务订阅/产品报告等理财服务。满足贵宾用户基金投资建议和专业资产配置需要。">

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/saved_resource(1).css">
<script src="${pageContext.request.contextPath}/css/hm.js"></script><script async="" src="${pageContext.request.contextPath}/js/analytics.js"></script><script type="text/javascript" src="${pageContext.request.contextPath}/css/saved_resource(2).css"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/css/saved_resource(3).css"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/css/saved_resource(4).css"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/css/saved_resource(5).css"></script>
<!--<base target="_blank">--><base href="." target="_blank">
<script type="text/javascript">
$(document).ready(function() {
	var b = '';
	if(b == null || b == ""){
		$("#bill").remove();
	}
});
</script>

<style id="tsbrowser_video_independent_player_style" type="text/css">


      [tsbrowser_force_max_size] {
        width: 100% !important;
        height: 100% !important;
        left: 0px !important;
        top: 0px !important;
        margin: 0px !important;
        padding: 0px !important;
        transform: none !important;
      }
      [tsbrowser_force_fixed] {
        position: fixed !important;
        z-index: 9999 !important;
        background: black !important;
      }
      [tsbrowser_force_hidden] {
        opacity: 0 !important;
        z-index: 0 !important;
      }
      [tsbrowser_hide_scrollbar] {
        overflow: hidden !important;
      }
      [tsbrowser_display_none] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
      }
      [tsbrowser_force_show] {
        display: black !important;
        visibility: visible !important;
        opacity: 0;
      }</style></head>
<body style="">
	<div class="top_nav_box">
	<div class="top_nav_layout w1000 clearfix">
		<div class="top_n_hotline lt">金牛热线：4006 5478 213</div>
			<div class="top_n_right rt clearfix">
				<div class="loginname lt"><span>${requestScope.clientData.cAccount}</span>[<a href="/Anonymous/clientExit">退出</a>]</div>
				<div class="top_nav lt">
					<dl>
						<dt class=""><a href="javascript:">工具<em></em></a></dt>
						<dd style="display: none;">
							<ul>
								<li><a href="https://www.howbuy.com/fundtool/zixuan.htm" target="_blank">自选基金</a></li>
								<li><a href="https://www.howbuy.com/myfund/index.htm" target="_blank">基金账本</a></li>
								<li><a href="https://www.howbuy.com/fundtool/filter.htm" target="_blank">基金筛选</a></li>
								<li><a href="https://www.howbuy.com/fundtool/compare.htm" target="_blank">基金对比</a></li>
							</ul>
						</dd>
					</dl>
					<dl>
						<dt><a href="javascript:">导航<em></em></a></dt>
						<dd>
							<ul>
								<li><a href="https://www.howbuy.com/" target="_blank">金牛首页</a></li>
								<li><a href="https://www.howbuy.com/fund/" target="_blank">公募基金</a></li>
								<li><a href="https://www.howbuy.com/licai/" target="_blank">银行理财</a></li>
								<li><a href="https://simu.howbuy.com/" target="_blank">私募基金</a></li>
								<li><a href="https://www.howbuy.com/trust/" target="_blank">信托产品</a></li>
								<li><a href="https://www.howbuy.com/vcpe/" target="_blank">私募股权</a></li>
								<li><a href="https://www.howbuy.com/about/" target="_blank">关于金牛</a></li>
							</ul>
						</dd>
					</dl>
					<dl>
						<dt><a href="javascript:">关注<em></em></a></dt>
						<dd>
							<ul>
								<li><a href="https://www.howbuy.com/subject/weixin/" target="_blank" class="weixin">加微信</a></li>
								<li><a href="http://e.weibo.com/howbuyfund" target="_blank" class="weibo">粉微博</a></li>
							</ul>
						</dd>
					</dl>
				</div>
			</div>
		</div>
	</div>
	<!-- top_nav_box end -->	
	<!-- header begin -->
	<div class="header w1000">
		<!--<div class="logo lt">
			<a target="_blank" href="http://www.howbuy.com/"><img alt="" src="${pageContext.request.contextPath}/img/howbuy_logo1.0.png"></a></div>
		<div class="hd_mini_ad lt">
			<a target="_blank" href="http://www.howbuy.com/mobile/zsjj/"><img border="0" alt="掌上基金" src="${pageContext.request.contextPath}/img/f640b36d-3d56-4653-8268-77a3919f0a08.png"></a>
		</div>-->
		<ul class="menu rt">
			<li><a href="https://i.howbuy.com/member/myhowbuy/" value="/member/myhowbuy/,/member/account/,/member/custom/,/member/integral/,/member/kyc/" target="_self">我的金牛</a></li>
			<li class="current"><a href="https://i.howbuy.com/member/property/index.htm" value="/member/property/,/member/transaction/" target="_self">账户资产</a></li>
			
			<li><a href="https://i.howbuy.com/member/report/product.htm" value="/member/report/" target="_self">产品报告</a></li>
			<li style="margin-right:0"><a href="https://www.howbuy.com/subject/zcjlb03/" class="cRed" target="_blank">臻财俱乐部</a></li>
		</ul>
		
		
			
	</div>
	<!-- header end -->
 
	<div style="background-color: #f3f5f6;width: 100%;border-top: 1px solid #e3e1de;
	height: 34px;position: absolute;top: 120px;">
		<div class="sub_menu" style="position: absolute;top: 0px;left: 240px;z-index: 100px;">
			<div class="w1000">
				<ul>
					<li class="current"><a href="/Anonymous/myPosition" target="_self">我的持仓</a></li>
					<li><a href="/Anonymous/acceptAffirm" target="_self">交易查询</a></li>
				</ul>
			</div>
		</div>
	</div>
<!-- main begin -->
<div class="main w1000">

	<div class="holdDetailBox mt60">
		<div class="clearfix">
			<div class="zcBox lt w300">
				<a href="javascript:void(0)">总资产（元）<i class="on"></i></a>
                <p class="cBold" id="totalAssets">${requestScope.myPurseData.overAllAsset}</p>
				<div class="lockedNum"><i></i><span>${requestScope.myPurseData.frozenMoney}</span>元</div>
			</div>
			<div class="zcBox lt w180">
				<a href="javascript:void(0)">基金日收益（0825）</a>
                <p class="cBold cGreen" id="dayMoney"></p>
			</div>
			<div class="zcBox lt w220">
				<a href="javascript:void(0)">现存基金总收益（元）</a>
				<p class="cBold cGreen" id="resultMoney"></p>
			</div>
			<div class="zcBox lt w220">
				<a href="javascript:void(0)">账户当前状态</a>
				<p class="cBold cGreen">${requestScope.myPurseData.accountStatus}</p>
			</div>
		</div>

	</div>

    <div class="ccBox mt20">
		<div class="typList">
			<div class="typName mt20" id="1">公募基金</div>
			<c:forEach var="data"  items="${requestScope.fundHoldData}">
				<div class="typBox mt20">
					<p class="title"><span class="label lab2">公募</span>${data.fName}</p>
					<div class="clearfix mt20 ">
						<div class="lt w160"><span>持有份额（位）</span><p class="cGray3 shares">${data.shares}</p></div>
						<div class="lt w190"><span>买时净值（元）</span><p class="cGray3 startDwjz" id="${data.startDwjz}">${data.startDwjz}</p></div>
						<div class="dwjz" style="display: none">${data.dwjz}</div>
						<%--数据更新时间--%>
						<div class="dataUpdateTime" style="display: none">${data.dataUpdateTime}</div>
						<%--昨天的单位净值--%>
						<div class="yesterDayDwjz" style="display: none">${data.yesterDayDwjz}</div>
						<div class="lt w160"><span>购买时间（元）</span><p class="startTime"  style="font-size: 16px;color: #DD001B;">${data.startTime}</p></div>
						<div class="lt w200" >
							<span>总收益（07-14）
							</span>
							<p><span class="earnings"></span><span style="font-size: 15px;color: #DD001B;">（<span class="cGreen earningsPercent" style="font-size: 15px;color: #DD001B;"></span>%）</span></p>
						</div>
						<div style="display: none;" class="fhId">${data.fhId}</div>
						<div class="rt linkBox">
								<a href="https://trade.ehowbuy.com/newpc/pcfund/module/pcfund/view/chooseExchangeInFund.html?fundCode=202101&amp;protocalNo=1521071011405200000007692&amp;fundTxAcctNo=1450187692&amp;shareClass=A" class="alink red">转投</a>
								<a href="https://trade.ehowbuy.com/newpc/pcfund/module/pcfund/view/buyFund.html?fundCode=202101" class="alink">买入</a>
								<a href="/Anonymous/redeem?fhId=${data.fhId}" class="alink">卖出</a>
						</div>
					</div>
				</div>
			</c:forEach>
		</div>
	</div>

	<!-- type_box end -->
	<ul class="bot_info">
		<li>重要提示：</li>
		<li>请认真核对上述信息，如有任何疑问，请及时与您的投资顾问或客服热线（<span class="cRed">400-700-9665</span>）联系。</li>
		<li>为确保您能及时收到我司提供的相关信息，如您的联系方式发生变动，请及时通知您的投资顾问或拨打我司客服热线（<span class="cRed">400-700-9665</span>）进行修改。</li>
	</ul>
</div>
<!-- main end -->


<script type="text/javascript">
	$(function(){
	    var totalAssets = $("#totalAssets").html();
		//我的持仓 问号小提示
		$('.top_t_tips .t').bind('mouseenter',function(){
			var _this = $(this);
			 _this.next().show();
			 _this.parent().bind('mouseleave',function(){
				_this.next().hide();
			 });
		});

		//债券 手风琴效果
		$(".bond_box .bond_t").hover(function(){
			$(".type_box").find(".bond_c").hide();
			$(".type_box").find(".bond_t").removeClass("hover");
			$(this).next().show();
			$(this).addClass("hover");
		})

        /*总资产眼睛*/
        $('.zcBox a i').on('click',function(){
            $(this).toggleClass('on');
            if($(this).is('.on')){
                $("#totalAssets").html(totalAssets);
			}else {
                $("#totalAssets").html("****");
            }
        });

        /*提示文案*/
        $('.typBox .tip').on('mouseover',function(){
            $(this).find('.msg').removeClass('hide');
        }).on('mouseleave',function(){
            $(this).find('.msg').addClass('hide');
        })
	});

    var data1=[];
    var data2=[];

            var val = {
                value: "",
                name: ""
            };

            var val2 = {
                value: "",
                color: "",
                name: ""
            };
            val.value = 0.99;
            val2.value = -0.01;
                val2.name = val.name = "公募基金";
                val2.color = '#5a79a8';
            data1.push(val);
            data2.push(val2);
            var val = {
                value: "",
                name: ""
            };

            var val2 = {
                value: "",
                color: "",
                name: ""
            };
            val.value = 0;
            val2.value = 0;
                val2.name = val.name = "私募基金";
                val2.color = '#254d62';
            data1.push(val);
            data2.push(val2);
            var val = {
                value: "",
                name: ""
            };

            var val2 = {
                value: "",
                color: "",
                name: ""
            };
            val.value = 0;
            val2.value = 0;
                val.name = "活期";
                val2.color = '#c43d35';
                val2.name = "储蓄罐活期";
            data1.push(val);
            data2.push(val2);
            var val = {
                value: "",
                name: ""
            };

            var val2 = {
                value: "",
                color: "",
                name: ""
            };
            val.value = 0;
            val2.value = 0;
                val2.name = val.name = "活期+";
                val2.color = '#f67c2f';
            data1.push(val);
            data2.push(val2);
            var val = {
                value: "",
                name: ""
            };

            var val2 = {
                value: "",
                color: "",
                name: ""
            };
            val.value = 0;
            val2.value = 0;
                val2.name = val.name = "定期";
                val2.color = '#90b4ec';
            data1.push(val);
            data2.push(val2);
    createPieChart(data1);//饼状图
    createBarChart(data2);//柱状图
</script>



<div class="footer noprint">
        <a target="_blank" href="https://www.howbuy.com/about/map.html">网站地图</a> |  <a href="https://www.howbuy.com/about/contactus.html" target="_blank" title="联系我们">联系我们</a> |  <a href="https://www.howbuy.com/about/joinhowbuy.html" target="_blank" title="诚聘英才">诚聘英才</a> |  <a href="https://www.howbuy.com/about/useitem.html" target="_blank">使用条款</a> |  <a href="https://www.howbuy.com/about/privacyitem.html" target="_blank">隐私条款</a> |  <a href="https://www.howbuy.com/about/venturehint.html" target="_blank">风险提示</a> | <a target="_blank" href="https://www.howbuy.com/about/">关于金牛</a>
    <br>版权所有 金牛财富管理股份有限公司<span class="fontArial">Copyright © howbuy.com, inc 2021. All rights reserved.</span> [ ICP备08003295号]


	<div id="count">${requestScope.count}</div>
</div>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
  ga('create', 'UA-3291121-1', 'auto');
  ga('send', 'pageview');
</script>

<script>
//baidu
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?d7da8e068ed3fc9fddf36e1474d491a2";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript" defer="defer" src="${pageContext.request.contextPath}/js/o_code.js"></script>
<script type="text/javascript" defer="defer" src="${pageContext.request.contextPath}/js/ha.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/css/saved_resource(6).css"></script>

<script type="text/javascript">
	//----------------------计算收益------------------
	var count1=0;
	var count2=0;
	var count3=0;
	var count4=0;
	var arr1 = new Array();
	var arr2 = new Array();
	if($(".startDwjz").html() != null){
		$(".startDwjz").each(function () {
			arr1[count1] = $(this).html();
			count1++;
		});
		$(".dwjz").each(function () {
			arr2[count2] = $(this).html();
			count2++;
		});
		$(".earnings").each(function () {
			console.log(arr2[count3]+" "+arr1[count3]);
			console.log(arr2[count3] / arr1[count3]);
			$(this).html((arr2[count3] / arr1[count3]).toFixed(3));
			//toFixed(3)保留三位小数
			count3++;
		});
		$(".earningsPercent").each(function () {
			var result = (arr2[count4] / arr1[count4]);
			result = (result-1) * 100;
			$(this).html(result.toFixed(2));
			//toFixed(3)保留三位小数
			count4++;
		});
		//--------------------------------------------------
		//----------------------计算总收益------------------
		var shares = new Array();
		var startDwjz = new Array();
		var dwjz = new Array();
		//获取持有份额
		$(".shares").each(function () {shares[shares.length] = parseFloat($(this).html())});
		//获取购买时净值
		$(".startDwjz").each(function () {startDwjz[startDwjz.length] = parseFloat($(this).html())});
		//获取基金单位净值
		$(".dwjz").each(function () {dwjz[dwjz.length] = parseFloat($(this).html())});
		console.log(shares);
		console.log(startDwjz);
		console.log(dwjz);

		//计算累计收益
		var result = 0;
		for (var i = 0; i < shares.length; i++) {
			//今天的dwjz * 份额减去开始的dwjz * 份额
			result += (shares[i] * dwjz[i]) - (shares[i] * startDwjz[i]);
		}
		$("#resultMoney").html(result.toFixed(2));
		//--------------------------------------------------


		//----------------------计算日收益------------------
		var dayResult = 0; //日收益
		var yesterDayDwjz = new Array(); //昨天的单位净值数据
		var startTime = new Array(); //获取购买时间

		$(".yesterDayDwjz").each(function () {yesterDayDwjz[yesterDayDwjz.length] = parseFloat($(this).html())});
		//获取今天基金单位净值 上面有
		//获取份额 上面有
		$(".startTime").each(function () {
			var startTimeNow = $(this).html().split(" ")[0].split("-");
			var str = startTimeNow[0]+""+startTimeNow[1]+""+startTimeNow[2];
			startTime[startTime.length] = str;
		});


		//今天
		var dateNow = new Date();
		var month = parseInt(dateNow.getMonth()+1);
		var newmonth = (month < 10 ? "0" + month : month); //10月以下的月份自动加0 加1是因为getMonth从0开始
		var newday = (dateNow.getDate() < 10 ? "0" + dateNow.getDate() : dateNow.getDate()); //10月以下的天数自动加0
		var strDay = dateNow.getFullYear()+""+newmonth+""+newday;



		//计算收益
		for (var i = 0; i < yesterDayDwjz.length; i++) {
			//今天的dwjz * 份额 减去昨天的dwjz * 份额
			//计算出来的就是日收益
			if(startTime[i] != strDay){
				console.log(startTime[i]+" "+strDay);
				dayResult += (shares[i] * dwjz[i]) - (shares[i] * yesterDayDwjz[i]);
			}
		}

		$("#dayMoney").html(dayResult.toFixed(2));
		//--------------------------------------------------


		// $(".earnings")[i].html(parseFloat($(".dwjz")[i].html()) / parseFloat($(".startDwjz")[i].html()));

		var count5=0;
		$(".startTime").each(function () {
			$(this).html($(this).html().split(" ")[0]);
			count5++;
		});


		var fhId = new Array();
		$(".fhId").each(function(){
			fhId[fhId.length]=$(this).html();
		});
		console.log(fhId);
		var dateStr = dateNow.getFullYear()+"-"+newmonth+"-"+newday;
		//给用户计算收益，然后改变我的钱包数据
		if (dateStr != $(".dataUpdateTime").html().split(" ")[0]){
			console.log($("#dayMoney").html());
			console.log($("#resultMoney").html());
			$.ajax({
				url: "/Anonymous/countEarnings",//请求地址
				type: "post",//请求方式
				async: false,//是否异步请求
				data: {
					dayMoney: $("#dayMoney").html(),
					resultMoney: $("#resultMoney").html(),
					fhIdArr:fhId
				}
			});
		}
	}


	var nowCount = $("#count").html();
	if (nowCount == 1){
		//处理好数据后跳回去
		location.href="/Anonymous/myPurseWeb";
	}




    $(function () {
        var a1 = window.location.href;
        var a2 = $(".header .menu a");
	   	for (var i = a2.length-1; i >= 0; i--) {
	   		if($(a2[i]).attr("target") == "_blank"){
	   			continue;
	   		}
	   		var avalue = $(a2[i]).attr("value").split(",");
	   		if(avalue.length>=0){
	   			for(var j = 0; j<avalue.length;j++){
	   				if (a1.indexOf(avalue[j])>=0) {
		                $(a2[i]).parent().addClass("current");
		                return;
		            }	
	   			}
	   		}
        }
        
    });
    
    
   $(function(){
   	if(getCookie("member_integral_close_tips")!="" && getCookie("member_integral_close_tips") == "close"){
   		$(".close_tips").parent().hide();
   	}else{
   		$(".close_tips").parent().show();
   	}
	 $('.tips').find('.close_tips').bind('click',function(){
	 		addCookie("member_integral_close_tips","close");
	       $(this).parent().hide();
		   return false;
	 });
   });
</script>
<div style="position: absolute;top: 45px;left: 240px;width: 300px;">
			<img style="width: 60px;height: 60px;" src="${pageContext.request.contextPath}/img/logo.png"></img><h1 style="position: absolute;top: 10px;left: 100px;font-size:32px;font-weight: bold;">基金交易平台</h1>
		</div>

</body></html>